<script>
import Vue from "vue";
import { mapMutations, mapActions } from "vuex";
export default {
  onLaunch: function() {
    console.log("App Launch");
    this.initHeaderHeight();
    this.initApp();
  },
  methods: {
    ...mapMutations(["setCustom", "setStatusHeight", "setBarHeight"]),
    ...mapActions(["initApp"]),
    initHeaderHeight() {
      uni.getSystemInfo({
        success: (e) => {
          this.setStatusHeight(e.statusBarHeight);
          // #ifndef APP-PLUS
          if (e.platform == "android") {
            this.setBarHeight(e.statusBarHeight + 50);
          } else {
            this.setBarHeight(e.statusBarHeight + 45);
          }
          // #endif
          // #ifdef MP-WEIXIN
          const custom = wx.getMenuButtonBoundingClientRect();
          this.setCustom(custom);
          this.setBarHeight(custom.bottom + custom.top - e.statusBarHeight);
          // #endif
        },
      });
    },
  },
};
</script>

<style lang="scss">
@import "./styles/base.scss";
@import "uview-ui/index.scss";
/*每个页面公共css */
</style>
